
var _oEvent;

function SelectValuesJsWindowOnLoad()
{

var _oValuesXml		= window.dialogArguments.valuesXml;




_iFieldSelectWidth		= 205;
_iFieldSelectHeight		= 145;
_sFieldSelectLeftTitle	=  LOCID_SELVALS_TITLE_AVAILVALS;
_sFieldSelectRightTitle	=  LOCID_SELVALS_TITLE_SELTDVALS;
_bFieldSelectShowUp		= false;
_bFieldSelectShowDown	= false;

var oNodes		= _oValuesXml.selectNodes("/select/option");

var iLen		= oNodes.length;

var sValuesAry		= new Array(2);
sValuesAry[0]	= new Array(iLen);
sValuesAry[1]	= new Array(iLen);

for (var i = 0; i < iLen; i++)
{
sValuesAry[1][i] = oNodes[i].text;
sValuesAry[0][i] = oNodes[i].getAttribute('value');
}


Quicksort( sValuesAry[1], 0, sValuesAry[0].length - 1, sValuesAry[0] );

var selectedList = window.dialogArguments.sSelectedValues.split(";");
iLen = selectedList.length;
var sSelectedAry = new Array(2);
sSelectedAry[0] = new Array(iLen);
sSelectedAry[1] = new Array(iLen);

var sSelectedValue = "";

for (var i = 0; i < iLen; i++)
{
sSelectedValue = selectedList[i];
if(sSelectedValue == "") continue;
var oNodes = _oValuesXml.selectNodes("/select/option");
for (var j = 0; j < oNodes.length; j++)
{
if(oNodes[j].getAttribute('value') == sSelectedValue)
{
sSelectedAry[1][i] = oNodes[j].text;
sSelectedAry[0][i] = oNodes[j].getAttribute('value');
break;
}
}
}

drawFieldSelect(sValuesAry, sSelectedAry);
}

window.attachEvent('onload', SelectValuesJsWindowOnLoad);

function applychanges()
{
var oRows	= rtnObjList.firstChild.rows;
var iLen	= rtnObjList.firstChild.rows.length;

var sDependsAry	= new Array();
sDependsAry		= GetReturnList();

window.returnValue	= sDependsAry;

window.close();
}

function cancel()
{
window.close();
}
